#pragma once
#include "ImportData.h"
#include "DataPoint.h"
#include <vmmlib/matrix.hpp>
#include <vmmlib/vector.hpp>
#include <Eigen/Eigen>
#include "Convoluter.h"
#include "Marching.h"
#include <iostream>
#include <queue>
#include "GridElement.h"
#include "Edge.h"
#include "Side.h"

using namespace std;
using namespace Eigen;

class RidgeDetector{   
public:
	RidgeDetector(void);
	RidgeDetector(ImportData* d);
	~RidgeDetector(void);
	void extractRidges(int slice);
	void extractRidges3d();
	queue<GridElement<Edge>> getRidgePoints2d();
	queue<GridElement<Edge>> getRidgeLines2d();
	queue<GridElement<Side>> getRidgePoints3d();
	queue<GridElement<Side>> getRidgeLines3d();
	queue<GridElement<Side>> getFaceLines();
	void setMostConvex(bool c);
	int getVertCount();
	int getTriCount();


private:
	Marching m;
	queue<GridElement<Edge>> grid_lines2d,grid_points2d;
	queue<GridElement<Side>> face_lines,grid_lines3d,grid_points3d;
	ImportData* data;
	int SLICE_WIDTH,SLICE_HEIGHT;
	Eigen::Matrix3d Gx;
	Eigen::Matrix3d Gy;
	Eigen::MatrixXd H;
	double sMin;
	int slice;
	queue<VectorXd> ridges;
};
